#include <stdio.h>
#include <stdlib.h>
#include "pfm/comm_arbiter.h"
#include "pfm/linear_schedule.h"
#include "pfm/comm_slab.h"
// pfm coalescing header


void testOneWorker()
{
	//printf("First Worker executed\n");
}
void testOne()
{
	printf("starting\n");
	while(1);
}

void testTwoWorker()
{
	//printf("Second worker executed\n");
}


void testTwo()
{
	while(1);
}

int main()
{
	
	unsigned int comm = init_comm_arbiter();
	init_slab_manager();
	
	init_scheduler(comm);


	printf("starting task one\n");
	PTASK taskone = create_new_task(1,&testOne,NULL);
	
	if (taskone != NULL)
	{
		printf("not null\n");
		create_worker(taskone,&testOneWorker,NULL,25,0);
		
	}
	
	
	PTASK tasktwo = create_new_task(1,&testTwo,NULL);
	
	if (tasktwo != NULL)
	{
		
		create_worker(tasktwo,&testTwoWorker,NULL,2,0);
		
	}
	run_task(taskone);
		run_task(tasktwo);
	wait_task(tasktwo);
}
